package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * 读取文件 读取字节储存到数组中
 */
public class CreateDemo4 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis =new FileInputStream("fos.txt");
        byte [] data =new byte[1024];
        int a;
        while ((a=fis.read(data))!=-1){
            System.out.println(new String(data));
        }
        fis.close();
    }
}
